package adv330;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * @author oldliu
 * @since 1.0
 */
public class FileRead2 {
    public static void main(String[] args) {
        //byte数组作为缓冲
        try {
            InputStream in=new FileInputStream("E:\\java_workspace\\IdeaProjects\\java83\\java高级\\src\\adv330\\FileTest4" +
                    ".java");
            byte b[]=new byte[20];
            int len=0;
            while ((len=in.read(b))>-1){
                String str=new String(b,0,len);
                System.out.println(str);
            }
            in.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
